<template>
  <div id="sceneMaking">
    <div class="scene-tabs">
      <div class="tabs">
        <span
          class="scene-tab-item"
          @click="handleScrollTab(0)"
          :class="{ active: sceneTab === 0 }"
          >全部</span
        >
        <span
          class="scene-tab-item"
          @click="handleScrollTab(1)"
          :class="{ active: sceneTab === 1 }"
          >金融营销</span
        >
        <span
          class="scene-tab-item"
          @click="handleScrollTab(2)"
          :class="{ active: sceneTab === 2 }"
          >财税沟通</span
        >
        <span
          class="scene-tab-item"
          @click="handleScrollTab(3)"
          :class="{ active: sceneTab === 3 }"
          >客服售后</span
        >
      </div>
      <div class="addSence" @click="goSceneMake()">情景制作</div>
    </div>

    <!-- 情景列表 -->
    <div class="scene-list">
      <div class="scene-list-item" v-for="item in sceneList" :key="item.id">
        <div class="item-details">
          <div class="item-icon"><img src="" alt="null" /></div>
          <div class="item-info">
            <div class="title">{{ item.title }}</div>
            <div class="desc">{{ item.description }}</div>
          </div>
        </div>
        <div class="item-btns">
          <div class="item-btns-left">
            <div class="fabu" :class="{ cancel: item.status === 1 }">
              {{ item.status === 0 ? "情景发布" : "取消发布" }}
            </div>
            <div class="fabu-status" v-if="item.status === 1">
              <img src="@/assets/img/sceneMaking/yifabu-icon.png" alt="null" />
              <span style="color: #4f46e5">已发布</span>
            </div>
          </div>
          <div class="item-btns-right">
            <div class="preview">预览</div>
            <div class="edit">修改</div>
            <div class="delete">删除</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sceneTab: 0,
      sceneList: [
        {
          id: 1,
          title: "全球市场震荡话题:财",
          description:
            "模拟私人银行理财经理向高净值客户推荐理财产 品的情景。客户具有较高风险承受能力，希望获 得较高收益。理 得较高收益。理 得较高收益。理 得较高收益。理 得较高收益。理",
          status: 0,
        },
        {
          id: 2,
          title: "全球市场震荡话题:财富类保险 营销",
          description:
            "模拟私人银行理财经理向高净值客户推荐理财产 品的情景。客户具有较高风险承受能力，希望获 得较高收益。理财经理需，推荐合适的理财",
          status: 1,
        },
        {
          id: 3,
          title: "全球市场震荡话题:财富类保险 营销",
          description:
            "模拟私人银行理财经理向高净值客户推荐理财产 品的情景。客户具有较高风险承受能力，希望获 得较高收益。理财经理需，推荐合适的理财",
          status: 1,
        },
      ],
    };
  },
  methods: {
    handleScrollTab(index) {
      this.sceneTab = index;
    },

    goSceneMake() {
      this.$router.push("/sceneMake/sceneMakeDetails");
    },
  },
  mounted() {},
};
</script>

<style lang="scss" scoped>
#sceneMaking {
  width: 1200px;
  margin: 0 auto;

  .scene-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    .tabs {
      display: flex;
      align-items: center;
      gap: 20px;
      .scene-tab-item {
        font-size: 14px;
        color: #252e54;
        cursor: pointer;
      }
      .scene-tab-item.active {
        padding: 7px 10px;
        font-weight: bold;
        color: #5b57ab;
        background: #f0f2ff;
        border-radius: 6px;
        box-sizing: border-box;
      }
      .scene-tab-item:hover {
        color: #5b57ab;
      }
    }
    .addSence {
      padding: 10px 17px;
      background: #4f46e5;
      border-radius: 4px;
      font-size: 16px;
      color: #ffffff;
      text-align: center;
      cursor: pointer;
      &:hover {
        background: #4338ca;
      }
    }
  }

  .scene-list {
    display: flex;
    flex-wrap: wrap;
    row-gap: 28px;
    column-gap: 40px;
    .scene-list-item {
      padding: 25px 40px 17px 24px;
      width: calc(50% - 20px);
      height: 240px;
      background: #ffffff;
      box-shadow: 0px 0px 28px 1px rgba(0, 0, 0, 0.08);
      border-radius: 20px;
      box-sizing: border-box;
      cursor: pointer;
      &:hover {
        box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
      }

      .item-details {
        display: flex;
        gap: 25px;

        .item-icon {
          flex-shrink: 0;
          width: 150px;
          height: 150px;
          border-radius: 10px;
          overflow: hidden;
          img {
            width: 100%;
            height: 100%;
          }
        }

        .item-info {
          flex: 1;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          .title {
            font-size: 24px;
            font-weight: bold;
            color: #374151;
            margin-bottom: 7px;
          }
          .desc {
            font-size: 16px;
            color: #374151;
            height: 73px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
          }
        }
      }

      .item-btns {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 20px;
        .item-btns-left {
          display: flex;
          align-items: center;
          gap: 23px;
          font-size: 16px;
          .fabu {
            width: 100px;
            height: 30px;
            background: #4f46e5;
            border-radius: 5px;
            color: #fff;
            cursor: pointer;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: center;
            &.cancel {
              background: #827ce4;
              color: #fff;
            }
          }
          .fabu-status {
            display: flex;
            align-items: center;
            gap: 5px;
          }
        }
        .item-btns-right {
          flex: 1;
          display: flex;
          justify-content: flex-end;
          align-items: center;
          gap: 24px;
          .preview,
          .edit,
          .delete {
            font-size: 16px;
            color: #4f46e5;
          }
        }
      }
    }
  }
}
</style>